-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional filters and tests #163
Conversation
Filters: - `instantiated_type`: Filters a type to return the instantiated type. - `enum_type`: Filters a type to return the enum type or an error if the type is not an enum. Tests: - `enum`: Tests if an attribute has an enum type. - `simple_type`: Tests if a type is a simple type (i.e.: string | string[] | int | int[] | double | double[] | boolean | boolean[]). - `template_type`: Tests if a type is a template type (i.e.: template[]). - `enum_type`: Tests if a type is an enum type.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
=======================================
+ Coverage 74.7% 75.2% +0.4%
=======================================
Files 45 45
Lines 2627 2704 +77
=======================================
+ Hits 1963 2034 +71
- Misses 664 670 +6 ☔ View full report in Codecov by Sentry. |
if current_inferred_type != member_type { | ||
// If the inferred type is different from the member type, then the enum | ||
// type is "promoted" to a string. | ||
Some("string".to_owned()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is the right way to go... We may need to improve enum in the model so type is actually specified AND enforced on members.
This PR adds/updates the following filters:
instantiated_type
: Filters a type to return the instantiated type.enum_type
: Filters a type to return the enum type or an error if the type is not an enum.capitalize_first
: Capitalizes the first letter of a string.map_text
introduces a second parameter to define the default value if the name of the text map or the input are not found in thetext_maps
section (optional parameter).This PR adds the following tests:
enum
: Tests if an attribute has an enum type.simple_type
: Tests if a type is a simple type (i.e.: string | string[] | int | int[] | double | double[] | boolean | boolean[]).template_type
: Tests if a type is a template type (i.e.: template[]).enum_type
: Tests if a type is an enum type.Documentation has been updated.
Unit tests have been created.